package com.example.baiduai.Controller;

import com.example.baiduai.model.Sample;
import com.example.baiduai.model.Str;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RestController
@RequestMapping("/api/ai")
public class AiController {


    @RequestMapping("/chat")
    public String aiChat(@RequestBody Str s) throws IOException {
        Sample sample = new Sample();
        String result = sample.outResult(s.getStr());
        return result;
    }


}
